package com.bytecodezz.app.framework.better

import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity

/** 扩展方法**/
fun FragmentActivity.toast(message: String, duration: Int? = null) {
    Toast.makeText(this, message, duration ?: Toast.LENGTH_SHORT).show()
}

/** 扩展方法**/
fun Fragment.toast(message: String, duration: Int? = null) {
    activity?.run {
        Toast.makeText(this, message, duration ?: Toast.LENGTH_SHORT).show()
    }
}